import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const a = ref(0)
  const obj = ref({ name: '张三', age: 18, sex: 1 })
  const doubleA = computed(() => a.value * 2)
  function increment() {
    a.value++
  }

  return { a, doubleA, increment, obj }
})
